﻿using System;
using System.Collections.Generic;
using System.Text;

namespace DCIMAP.GANS.GeneticAlgorithms.Legacy
{
    class StringArrayGenerator: Generator
    {
        private int length;

        public StringArrayGenerator(int length)
        {
            this.length = length;
        }

         public StringArrayGenerator()
            : this(0) {}

         public int Length
         {
             get { return length; }
             set { length = value; }
         }

         public override Gene Generate()
         {
             StringArrayGene gene = new StringArrayGene(length);
             for (int i = 0; i < gene.StringCode.Length; i++)
                 gene.StringCode[i] = (Algorithm.Random.Next(2) == 1)?"0":"1";
             return gene;
         }
    }
}
